Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: only copy current harness version to trial [DET-3681] #952

Merged
merged 2 commits into from
Jul 27, 2020
Merged

chore: only copy current harness version to trial [DET-3681] #952

merged 2 commits into from
Jul 27, 2020

Conversation

stoksc
Copy link
Contributor

@stoksc stoksc commented Jul 25, 2020

Description

Change the determined whl's we copy to the harness from *.whl to *$(VERSION)*.whl.

Test Plan

  • run patch with multiple versions of whl's and run a trial successfully.

Commentary (optional)

This may be a naïve solution, but it seems just fine. The only thing I worry about is breaking some dev flow for the harness so that why I threw you on this, @aaron276h.

Copy link
Contributor

@aaron276h aaron276h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stoksc YES! this is definitely been a very annoying in the past. This solution is good, only development corner case I see is if the version gets bumped and the harness isn't rebuilt, but that is much easier to debug/fix than what we had before.

@@ -22,7 +24,8 @@ const (

func harnessArchive(harnessPath string, aug *model.AgentUserGroup) container.RunArchive {
var harnessFiles archive.Archive
wheelPaths, err := filepath.Glob(filepath.Join(harnessPath, "*.whl"))
validWhlNames := fmt.Sprintf("*%s*.whl", version.Version)
wheelPaths, err := filepath.Glob(filepath.Join(harnessPath, validWhlNames))
if err != nil {
panic(errors.Wrapf(err, "error finding Python wheel files in path: %s", harnessPath))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: add in the the version we are looking for into the error message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure, I thought about it but it seemed redundant since the det version should be obvious, but couldn't hurt.

@aaron276h aaron276h assigned stoksc and unassigned aaron276h Jul 25, 2020
@@ -22,7 +24,8 @@ const (

func harnessArchive(harnessPath string, aug *model.AgentUserGroup) container.RunArchive {
var harnessFiles archive.Archive
wheelPaths, err := filepath.Glob(filepath.Join(harnessPath, "*.whl"))
validWhlNames := fmt.Sprintf("*%s*.whl", version.Version)
wheelPaths, err := filepath.Glob(filepath.Join(harnessPath, validWhlNames))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we expect the wheelPaths to be predictable / something we should check?

Copy link
Contributor Author

@stoksc stoksc Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, it should always be $(ROOT)/wheels/determined*$(VERSION)*.whl where ROOT is root from master.yml and version is the version that is set by ldflags flag to go build when we build the master. Based on that, I guess this filepath.Glob could be even more specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names themselves are standardized by the PEP for whl's, https://www.python.org/dev/peps/pep-0427/#file-name-convention. (I didn't know this, was curious)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I mean len(wheelPaths) -- i.e., do we expect to find exactly 1 and should we check for that?

Copy link
Contributor Author

@stoksc stoksc Jul 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it should always be 3 (since determined, determined-cli and determined-common should be in $ROOT/wheels).

Copy link
Contributor

@neilconway neilconway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this!

@stoksc stoksc merged commit 274c628 into determined-ai:master Jul 27, 2020
@stoksc stoksc deleted the only-copy-current-harness-version-to-trial branch July 27, 2020 13:04
@dannysauer dannysauer added this to the 0.12.13 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants